# -*- coding: utf-8 -*-
#
# File: Liga.py
#
# Copyright (c) 2008 by []
# Generator: ArchGenXML Version 2.1
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """unknown <unknown>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import \
    ReferenceBrowserWidget
from Products.BeisPlone.config import *

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='title',
        widget=StringField._properties['widget'](
            label="Nombre de Liga",
            description="Escriba el nombre de la liga",
            label_msgid='BeisPlone_label_title',
            description_msgid='BeisPlone_help_title',
            i18n_domain='BeisPlone',
        ),
        required=True,
        accessor="Title",
        searchable=True,
    ),
    StringField(
        name='categoria',
        widget=SelectionWidget(
            label="Categoría",
            description="Seleccione categoría de la liga",
            label_msgid='BeisPlone_label_categoria',
            description_msgid='BeisPlone_help_categoria',
            i18n_domain='BeisPlone',
        ),
        vocabulary=['compota','preinfantil','infantil','prejunior','junior','juvenil'],
    ),
    DateTimeField(
        name='fecha_inicio',
        widget=DateTimeField._properties['widget'](
            label="Fecha de Inicio",
            description="Fecha de inicio de la liga",
            label_msgid='BeisPlone_label_fecha_inicio',
            description_msgid='BeisPlone_help_fecha_inicio',
            i18n_domain='BeisPlone',
        ),
    ),
    DateTimeField(
        name='fecha_fin',
        widget=DateTimeField._properties['widget'](
            label="Fecha de Finalización",
            description="Fecha de finalización de la liga",
            label_msgid='BeisPlone_label_fecha_fin',
            description_msgid='BeisPlone_help_fecha_fin',
            i18n_domain='BeisPlone',
        ),
    ),
    ReferenceField(
        name='equipos',
        widget=ReferenceBrowserWidget(
            label='Equipos',
            label_msgid='BeisPlone_label_equipos',
            i18n_domain='BeisPlone',
        ),
        allowed_types=('Equipo',),
        multiValued=1,
        relationship='liga_equipo',
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

Liga_schema = BaseFolderSchema.copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class Liga(BaseFolder, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()

    implements(interfaces.ILiga)

    meta_type = 'Liga'
    _at_rename_after_creation = True

    schema = Liga_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods


registerType(Liga, PROJECTNAME)
# end of class Liga

##code-section module-footer #fill in your manual code here
##/code-section module-footer



